package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.wx.catalog.vo.BaseCatalogDataVo;
import com.cskaoyan.service.wx.WxCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Name : WxCatalogController.java
 * @Time : 2021/8/15 16:02
 * @Author : creamycandy
 * @Software : IntelliJ IDEA
 */

@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {

    @Autowired
    WxCatalogService wxCatalogService;

    @RequestMapping("index")
    public BaseRespVo getCatalogs(){
        BaseCatalogDataVo catalogIndex = wxCatalogService.getCatalogIndex();
        return BaseRespVo.ok(catalogIndex);
    }


    @RequestMapping("current")
    public BaseRespVo getCurrentCatalog(Integer id){
        BaseCatalogDataVo catalogCurrent = wxCatalogService.getCatalogCurrent(id);
        return BaseRespVo.ok(catalogCurrent);
    }
}
